Reconciling Subtyping and Code Reuse in Object-Oriented Languages: Using inherit and insert in SmartEiffel, the GNU Eiffel Compiler

نویسندگان

  • Dominique Colnet
  • Guillem Marpons-Ucero
  • Frederic Merizen
چکیده

SmartEiffel has been enjoying two different mechanisms to express subtyping and implementation inheritance for one year. After large scale practical tests and thanks to user feedback, this paper finalises the new typing policy of SmartEiffel, which combines two forms of multiple inheritance with genericity in one statically-checked, object-oriented language. Having two forms of inheritance allows the designer to capture more design decisions in the source code. It is now straightforward to share reusable code between otherwise unrelated types. The new mechanism allows to reuse code from an existing class without polluting the reuser’s interface. It also enables an elegant implementation of some design patterns. Furthermore this mechanism helps compilers to statically remove more dynamic dispatch code. It can also be used to add a no-penalty and norisk multiple-inheritance-like construct to a single-inheritance language such as Java.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Optimizations of Eiffel Programs: Smalleiffel, the GNU Eiffel Compiler

The design of the Eiffel language makes it possible to perform global optimizations on Eiffel programs. In this paper, we describe some of the techniques we used in SmallEiffel, The GNU Eiffel Compiler, to generate highly efficient executables for Eiffel programs. Most of these techniques — related to global analysis or not — may also be applied to other objectoriented languages.

متن کامل

Automatic Translation of C Source Code to Eiffel

Can we reuse some of the huge code-base developed in C to take advantage of modern programming language features such as type safety, object-orientation, and contracts? This paper presents a source-to-source translation of C code into Eiffel, a modern object-oriented programming language, and the supporting tool C2Eif. The translation is completely automatic and supports the entire C language (...

متن کامل

SCOOP An Investigation of Concurrency in Eiffel

Bertrand Meyer has defined an inter-object concurrency mechanism for the Eiffel language. The mechanism, SCOOP (Simple Concurrent Object-Oriented Programming), differs significantly from the concurrency mechanisms of Java, and many other objectoriented languages. This thesis presents the mechanism described by Meyer. Its properties are considered, and a model that describes SCOOP is derived. Fr...

متن کامل

Subtyping for mutable types in object-oriented programming languages

Subtype relationships in object-oriented programming languages are studied to aid code reuse and reasoning about programs that use subtype polymorphism. We de ne what it means for one abstract data type to be a subtype of another. This de nition allows for both mutation and aliasing. This work gives intuition for programmers and guidance to language designers.

متن کامل

CLOS Eiffel and Sather: A Comparison

data types, inheritance, dynamic binding and garbage collection. bstract data types provide encapsulation and inheritance eases reuse. Both promote extensibility and modi ability. These two requirements seem widely accepted and we will not address them further. ynamic binding of functions to function names is one key to the exibility and extensibility of object-oriented languages. It allows new...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006